<template>
  <w-content-box
    :class-model="classModel"
    :options="searchOptions">
    <template v-slot="scope">
      <el-row :gutter="20">
        <el-col :span="8">
          <span class="log-text w-text-warp">{{ scope.item.defaultTag }}</span>
        </el-col>
        <el-col :span="8">
          <span class="log-text">{{ scope.item.userName }}</span>
        </el-col>
        <el-col :span="8">
          <span class="log-text">{{ scope.item.dateStr }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="4">
          <span class="log-text w-text-warp">{{ scope.item.url }}</span>
        </el-col>
        <el-col :span="2">
          <span class="log-text w-text-warp">{{ scope.item.reqType }}</span>
        </el-col>
        <el-col :span="16">
          <span class="log-text w-text-warp">{{ scope.item.params }}</span>
        </el-col>
        <el-col :span="2">
          <span
            class="log-text"
            :class="{ error: scope.item.success !== 'true' }">{{ scope.item.success }}</span>
        </el-col>
        <el-col
          :span="24"
          v-if="scope.item.err">
          <span class="log-text">{{ scope.item.err }}</span>
        </el-col>
      </el-row>
      <p
        class="log-text"
        v-if="scope.item.userAgent">{{ scope.item.userAgent }}</p>
    </template>
  </w-content-box>
</template>

<script>
  import LogWebAjaxModel from '@/models/logs/LogWebAjaxModel'
  import WContentBox from '../../com/contentBox'

  export default {
    name: "PCAdminLogsWebAjax",
    components: {
      WContentBox
    },
    data() {
      return {
        /**
         * 列表加载模型
         */
        classModel: LogWebAjaxModel,
        searchOptions: [
          {
            title: '用户名',
            key: 'userName'
          }, {
            title: '默认标记',
            key: 'defaultTag'
          }, {
            title: '请求参数',
            key: 'params'
          }, {
            title: '请求地址',
            key: 'url'
          }, {
            title: '请求类型',
            key: 'reqType'
          }, {
            title: '是否成功',
            key: 'success'
          }, {
            title: '路由Query',
            key: 'routerQuery'
          }, {
            title: '设备型号',
            key: 'userAgent'
          },
        ]
      }
    }
  }
</script>

<style lang="scss" scoped>
</style>
